package com.liy.cloud.base.rest;

import com.liy.cloud.base.entity.BaseOperLine;
import com.liy.cloud.base.service.BaseOperLineService;
import com.das.framework.common.annotation.ActionPermission;
import com.das.framework.common.annotation.MethodPermission;
import com.das.framework.common.extvo.ResultVO;
import com.das.framework.common.web.controller.BaseCrudController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.Map;

/**
 * 运营商线路信息表 服务
 * @ClassName: BaseOperLineRest
 * @Description: 
 * @author zhangw
 * @date 2019-08-26 22:43:05
 */
@RestController
@RequestMapping("/operline")
@ActionPermission(code="BASE.OPERLINE", description="运营商线路信息表")
public class BaseOperLineRest extends BaseCrudController<BaseOperLineService, BaseOperLine>{


    @Autowired
    private BaseOperLineService baseOperLineService;

    @RequestMapping(
            value = {"/save"},
            method = {RequestMethod.POST}
    )
    @ResponseBody
    @MethodPermission(
            codes = {"INSERT"},
            description = "新增"
    )
    public ResultVO save(@RequestBody Map<String, Object> params) {
        try {

            ArrayList list = (ArrayList)params.get("lineList");
            String opId = (String) params.get("opId");
            this.baseOperLineService.save(list, opId);
            return new ResultVO(true, "保存成功", "200");
        } catch (Exception var4) {
            log.error(var4.getMessage(), var4);
            return new ResultVO(false, "新增时发生错误:" + var4.getMessage(), "500");
        }
    }
}    